package com.ruoyi.project.mydy.searchrecord.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mydy.searchrecord.mapper.DlSearchRecordMapper;
import com.ruoyi.project.mydy.searchrecord.domain.DlSearchRecord;
import com.ruoyi.project.mydy.searchrecord.service.IDlSearchRecordService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 搜索关键词记录Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-07
 */
@Service
public class DlSearchRecordServiceImpl implements IDlSearchRecordService 
{
    @Autowired
    private DlSearchRecordMapper dlSearchRecordMapper;

    /**
     * 查询搜索关键词记录
     * 
     * @param id 搜索关键词记录主键
     * @return 搜索关键词记录
     */
    @Override
    public DlSearchRecord selectDlSearchRecordById(Long id)
    {
        return dlSearchRecordMapper.selectDlSearchRecordById(id);
    }

    /**
     * 查询搜索关键词记录列表
     * 
     * @param dlSearchRecord 搜索关键词记录
     * @return 搜索关键词记录
     */
    @Override
    public List<DlSearchRecord> selectDlSearchRecordList(DlSearchRecord dlSearchRecord)
    {
        return dlSearchRecordMapper.selectDlSearchRecordList(dlSearchRecord);
    }

    /**
     * 新增搜索关键词记录
     * 
     * @param dlSearchRecord 搜索关键词记录
     * @return 结果
     */
    @Override
    public int insertDlSearchRecord(DlSearchRecord dlSearchRecord)
    {
        dlSearchRecord.setCreateTime(DateUtils.getNowDate());
        return dlSearchRecordMapper.insertDlSearchRecord(dlSearchRecord);
    }

    /**
     * 修改搜索关键词记录
     * 
     * @param dlSearchRecord 搜索关键词记录
     * @return 结果
     */
    @Override
    public int updateDlSearchRecord(DlSearchRecord dlSearchRecord)
    {
        return dlSearchRecordMapper.updateDlSearchRecord(dlSearchRecord);
    }

    /**
     * 批量删除搜索关键词记录
     * 
     * @param ids 需要删除的搜索关键词记录主键
     * @return 结果
     */
    @Override
    public int deleteDlSearchRecordByIds(String ids)
    {
        return dlSearchRecordMapper.deleteDlSearchRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除搜索关键词记录信息
     * 
     * @param id 搜索关键词记录主键
     * @return 结果
     */
    @Override
    public int deleteDlSearchRecordById(Long id)
    {
        return dlSearchRecordMapper.deleteDlSearchRecordById(id);
    }
}
